import styles from './index.module.scss'
export default function HomeListItem({ item }) {
  return (
    <>
      {item.type === 'banner' ? (
        <van-swipe class="my-swipe" autoplay={3000} indicator-color="white">
          <van-swipe-item>
            <img src={item?.data?.cover?.feed} alt="" />
            <div>{item.data?.category}</div>
          </van-swipe-item>
        </van-swipe>
      ) : (
        <>
          <div className={styles.listItem}>
            <img src={item?.data?.cover?.feed} alt="" style="width: 100%; height: 300px;" />
            <span>{item.data?.category}</span>
          </div>
          <div>
            <img
              src={item?.data?.author?.icon}
              alt=""
              style="width: 50px; height: 50px; border-radius: 50%;"
            />
            <div>
              <span>{item.data?.author?.name}</span>
            </div>
          </div>
        </>
      )}
    </>
  )
}
